#include "posinfo.hpp"

bool PosInfo::valid = false;
float PosInfo::posx = 0.0f;
float PosInfo::posy = 0.0f;
float PosInfo::posa = 0.0f;
std::mutex PosInfo::mtx;

void PosInfo::set(bool v, float x, float y, float a)
{
    std::lock_guard<std::mutex> lock(mtx);
    valid = v;
    posx = x;
    posy = y;
    posa = a;
}

void PosInfo::get(bool& v, float& x, float& y, float& a)
{
    std::lock_guard<std::mutex> lock(mtx);
    v = valid;
    x = posx;
    y = posy;
    a = posa;
}
